<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>JSON格式化</title>
    <script type="text/javascript" src="http://jic.betools.vip/common/web/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://jic.betools.vip/tools/js/json.js"></script>
</head>
<body>
    <textarea rows="20" cols="80" id="source">{"a":1,"b":2,"c":"\u6211\u662F\u5F20\u4E09"}</textarea>
    <button id="format">格式化</button>
    <button id="compress">压缩</button>
    <button id="decodeUnicode">Unicode转中文</button>
    <button id="getparams">转GET参数</button>
    <script>
    $("#format").click(function(){
        var html = $("#source").val();
        var format_content = formatJson2(html, false, false);
        $("#source").val(format_content);
    });

    $("#compress").click(function(){
        var html = $("#source").val();
        var format_content = formatJson2(html, true, false);
        $("#source").val(format_content);
    });

    $("#decodeUnicode").click(function(){
        var html = $("#source").val();
        var format_content = formatJson2(html, false, true);
        $("#source").val(format_content);
    });

    $("#getparams").click(function(){
        var html = $("#source").val();
        var format_content = jsonConvertGet(html);
        $("#source").val(format_content);
    });
    </script>
</body>
</html>
